package board.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import board.db.BoardDAO;
import board.db.BoardBean;

public class BoardCounts implements Hot_Girl_Action {
	 public Hot_Girl_ActionForward execute(HttpServletRequest request,HttpServletResponse response) throws Exception{ 
			request.setCharacterEncoding("utf-8");
	   		
			BoardDAO boarddao=new BoardDAO();
		   	BoardBean boarddata=new BoardBean();
		   	
			int num=Integer.parseInt(request.getParameter("num"));
			
			boarddao.setCountUpdate(num);
			boarddata=boarddao.getDetail(num);
		   	System.out.println("넌 무엇을 가지고 있냐"+num);
		   	if(boarddata==null){
		   		System.out.println("구종현");
		   		return null;
		   	}
		   	System.out.println("돌고있엉 걱정하지마1=");
		   	
		   	request.setAttribute("boarddata",boarddata);
		   	System.out.println("돌고있엉 걱정하지마2="+boarddata);
		   	Hot_Girl_ActionForward forward = new Hot_Girl_ActionForward();
		   	forward.setRedirect(false);
			System.out.println("돌고있엉 걱정하지마3="+forward);
		   	forward.setPath("../board/hot_girl_view.jsp");
		   	return forward;

		 }
	}